﻿CREATE VIEW [acms].[PostTopic_View]
AS 
	SELECT a.Id as PostId, 
		a.Name as PostName,
		a.DisplayName as PostDisplayName,
		c.Id as TopicId,
		c.Name as TopicName,
		b.VersionId 
	FROM [Posts] a 
		inner join [PostTopics] b on a.Id = b.PostId
		inner join [Topics] c on b.TopicId = c.Id
	Where a.Deleted = 0 and b.Deleted = 0 and c.Deleted = 0
;